import { http } from '@/utils/http/axios';


/**
 * @description: 获取用户table展示数据
 */
export function getTableList(params) {
  // console.log('getTableListparams', params);
  return http.request({
    url: '/project/employee_data',
    method: 'get',
    params: params,
  });
}

/**
 * @description: 获取项目信息下拉框数据
 */
export function getProjcetOptions(params) {
  // console.log('getProjcetOptionsparams', params);
  return http.request({
    url: '/project/projectOptions',
    method: 'GET',
    params: params,
  });
}

/**
 * @description: 获取班组下拉框信息数据
 */
export function getGroupOptions(params) {
  console.log('getGroupOptionsparams', params);
  return http.request({
    url: '/project/groupOptions',
    method: 'GET',
    params: params,
  });
}

/**
 * @description: 批量删除选中的数据
 */
export function batchDelUser(params) {
  console.log('batchdel param:', params);
  return http.request({
    url: '/project/user/batchDel',
    method: 'POST',
    data: params,
  });
}

/**
 * @description: 创建新用户
 */
export function createUser(params) {
  return http.request({
    url: '/project/add_employee',
    method: 'POST',
    params,
  });
}

/**
 * @description: 更新用户
 */
export function updateUser(params) {
  return http.request({
    url: '/project/update_employee',
    method: 'POST',
    params,
  });
}

/**
 * @description: edit初始化
 */
export function getEditInit(params) {
  return http.request({
    url: '/project/edit_employee_init',
    method: 'GET',
    params: params,
  });
}

/**
 * @description: 导入人员信息数据
 */
export function uploadExcel(params) {
  console.log('uploadExcel param:', params);
  return http.uploadFile({
    url: '/project/uploadExcel',
  },params);

}

//导出人员信息数据
export function getEmpExcel(params) {
  return http.request({
    url: '/project/getEmpExcel',
    method: 'get',
    responseType : 'blob',
    params,
  });
}
